import time
from selenium import webdriver
from common.config import config_option

# PhantomJS是一个无头界面的浏览器
browser = webdriver.PhantomJS(
    config_option['project_path'] + r'\\resources\\libs\\phantomjs-2.1.1-windows\\bin\\phantomjs.exe')

url = 'http://www.baidu.com/'
browser.get(url)
time.sleep(3)

# 进入百度界面    然后截屏
browser.save_screenshot(r'baidu.png')

bd_input = browser.find_element_by_id('kw').send_keys('小猪配齐')
# 在此截屏
browser.save_screenshot(r'pig.png')
time.sleep(3)

bd_sous = browser.find_element_by_id('su').click()
# 在此截屏
browser.save_screenshot(r'sous.png')
time.sleep(3)

browser.quit()
